//多线程的实现方式1：继承Thread类
/*
      * 1.自己定义一个类继承Thread
      * 2.重写run()方法
      * 3.创建子类对象，并启动线程
      */

package ThreadDemo1;

public class ThreadDemo {
    public static void main(String[] args) {

        MyThread t1 = new MyThread();
        MyThread t2 = new MyThread();
        t1.setName("线程1");
        t2.setName("线程2");

        t1.start();
        t2.start();

    }
}
